package com.xkcoding.orm.mybatis.plus.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xkcoding.orm.mybatis.plus.entity.Role;
import com.xkcoding.orm.mybatis.plus.mapper.RoleMapper;
import com.xkcoding.orm.mybatis.plus.service.RoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronizationManager;

/**
 * TODO
 *
 * @Author lingNan
 * @Date 2022/11/3 10:09
 **/
@Slf4j
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void trans() {
        log.info("role: " + String.valueOf(TransactionSynchronizationManager.isActualTransactionActive()));
    }
}
